﻿using System;
using RabbitMQ.Client;

namespace Infrastructure.Utility.Core.RabbitMq.Providers
{
    public interface ISubscriber
    {
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="connection"></param>
        /// <param name="callback"></param>
        void Subscribe<T>(IConnection connection, Action<T> callback) where T : class;
        void Subscribe<T>(IConnection connection, string queueName, string routeKey, Action<T> callback) where T : class;
    }
}
